# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        潘炎珍  
# Name:         test04
# Description:
# Author:       98745
# Date:         2019/4/24
#-------------------------------------------------------------------------------
import random
class Cards:
    #三个玩家共享一副牌
    cards = ['joker', 'Joker']
    def __init__(self):
        #每位玩家的牌
        self.shoupai = []

    # 生成一副牌其中的52张
    @staticmethod
    def scpai():
        L = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']
        H = ['红桃', '黑桃', '方块', '梅花']
        for x in H:
            for y in L:
                s = x + y
                Cards.cards.append(s)

    #洗牌
    @staticmethod
    def xipai():
        random.shuffle(Cards.cards)


Cards.scpai()
Cards.xipai()
player1 = Cards()
player2 = Cards()
player3 = Cards()
#先给player1玩家最好的牌
paishu = 0
while paishu < 17:
    pai = random.choice(Cards.cards)
    if pai in ['Joker','joker','2','2','2','2','A','A','A','A','K','K','K','K','Q','Q','Q']:
        player1.shoupai.append(pai)
        Cards.cards.remove(pai)
        paishu += 1
player2.shoupai = random.sample(Cards.cards,17)
player3.shoupai = random.sample(list(set(Cards.cards).difference(set(player2.shoupai))),17)

print(player1.shoupai)
print()
